Skip to content

fix(scenarios): the cited axis accepts the source a query_dataset answer tells the client to cite - #36092

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-a4B-35867
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-a4B-35867

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #35867

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:评测打分器内部改动,问数日轮里引用服务端数据集来源行的回答不再被误判为「未注明来源」。
  • 属于 AI 评测打分(问数日轮):按服务端指示引用来源的回答被扣分,会让车队依据的评分失真。
  • 出错只影响评测分数的「已注明来源」一项,不碰任何运行时;可直接撤回。
  • 无

What changes

gradeRun's cited axis (packages/qa/scenarios/src/score/scenario-run-grade.ts) accepted a source line only when it named the figure's object (machine name or a label) or the reply linked a record page of that object. A query_dataset answer's sourceLine names the dataset and its measures, never the object, and the door's nextStep tells the client to cite that line as given, so a reply that did exactly that lost cited on every dataset-routed figure.

Now, for a figure of object X, the grader also accepts what a query_dataset answer computed over X hands the client:

  • a source line (the existing Source: / 来源: line test) that names the answer's dataset, by provenance.dataset.name or provenance.dataset.label;
  • a reply line carrying the answer's sourceLine verbatim, which covers the Chinese line that opens with 指标 and carries no source word.

The tie to X is the answer's own top-level object (the dataset's base object, AnalyticsResultResponseSchema.data.object). The reader (datasetCitations, module-private) keys on the answer's shape: a top-level provenance of kind dataset is the query_dataset answer's own block. It does not key on the tool name, which kept @objectstack/spec/ai out of the narrow ./score entry's import graph (test/build/narrow-score-graph.test.ts pins that list). An answer with no object or no dataset provenance, a dataset over another object, and a line naming neither the object nor the dataset all still fail cited. No export, type or field is added to @objectstack/scenarios, so the Clause-② line stays no.

Also: one README sentence on the grader entry, and a patch changeset for @objectstack/scenarios.

First files to read (by risk):

  1. packages/qa/scenarios/src/score/scenario-run-grade.ts, the datasetCitations function and the cited loop in gradeRun. The risk is the widening: the dataset name or label is matched as a lowercased substring of a source line, the same way object labels already are.
  2. packages/qa/scenarios/test/score/scenario-run-grade.test.ts, the new describe under gradeRun.

Two-minute verification: pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/score/scenario-run-grade.test.ts should report 68 tests passing, three of them in the new query_dataset describe.

Tests

New describe in test/score/scenario-run-grade.test.ts, using the fixture from the issue (demotravel_expense_claim, dataset reimbursement / Reimbursement, the en sourceLine):

  • pass: the reply cites the server's sourceLine and gets the whole grade { correct: true, cited: true, leaks: [], problems: [] }. A line naming the dataset in other words passes too, and so does a bare Chinese sourceLine carried verbatim.
  • control: a line naming an unrelated source (Source: Travel budget) still fails cited with no source line for the demotravel_expense_claim figure(s).
  • control: a dataset answer over another object, an answer stating no object, and the same reply with no tool call all still fail cited.
Package run at d56aa34

Under the verify lock: pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios typecheck && pnpm --filter @objectstack/scenarios test. Result: VERDICT command-exit 0, Test Files 40 passed (40), Tests 1214 passed (1214). tsc --listFiles includes the edited test file.

Ablation (one-shot, not kept)

At d56aa34, scripts/ablation-replace.mjs replaced const served = datasetCitations(turn.toolCalls); with an empty map. The tool reported the anchor going from 1 to 0 and the blob changing from a7eec285dc1a to 82614fcd1c97. The test file then read Tests 1 failed | 67 passed (68). The one red test was the pass pin, passes cited on a reply that cites the server’s own sourceLine…. Both controls stayed green, which is the expected direction. After the restore the blob was a7eec285dc1a, equal to the HEAD blob, and git diff HEAD was empty. An earlier ablation at e77a0cf gave the same result.

Acceptance notes

  • scenario-dataset-grade.ts keeps its own private provenanceOf and outputJson. The new reader is a second reader of the same provenance block. Sharing one copy would need either a new module, which is outside this card's file surface, or a new export from scenario-run-grade.ts, which would be a public symbol through the export * re-exports. Neither is done here.
  • The match is a substring match on the dataset name or label, as it already is for object labels. A very short dataset label could match a line that only happens to contain it. This is the same exposure the object-label rule already has.

Verification

Gates are the dispatch-gates.mjs --commands list derived at d56aa34. The full repo farm and test:repo are CI's.

  • Derived list: 63 families. Run at d56aa34, each exit code captured before any pipe. 61 exited 0. --ran reconciliation: 63 derived, 61 run, 2 NOT-MEASURED, 0 UNRUN.
  • NOT MEASURED: check-plugin-teardown-shape.mjs --self-test exit 3. Reason: the shallow clone cannot reach its pinned positive-control commit.
  • NOT MEASURED: check:dual-build-cjs-loads exit 3. Reason: this worktree is not fully built (PREREQUISITE NOT MET). Its self-test passed. Both families run on CI.
  • check:nul-bytes, check:doc-authoring, check:issue-citations, check:cross-package-test-inputs, check:test-source-alias and check:published-files all exited 0.
  • origin/main moved 6 commits past the base 615d995, to 78f7160. None of them touches packages/qa/scenarios or packages/spec/src/ai / src/api. scripts/pm/overlap-check.mjs --pr=36065,36066,36077 returned VERDICT clean.
  • CI check-runs: in progress at open; the PR's checks are the record.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt

…hands the client

The cited axis accepted a source line only when it named the figure's object.
A query_dataset answer's sourceLine names the dataset and its measures, so a
reply citing it verbatim, as the door's nextStep instructs, lost cited. A
figure of the object a query_dataset answer was computed over is now also
cited by a source line naming that answer's dataset, or by the answer's
sourceLine carried verbatim.

Claude-Session: https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt
Co-authored-by: Claude <noreply@anthropic.com>
…n the cited axis

Claude-Session: https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt
Co-authored-by: Claude <noreply@anthropic.com>
…, not the tool name

Keying on the query_dataset tool name pulled @objectstack/spec/ai into the
narrow ./score entry's import graph, which narrow-score-graph.test.ts pins.
The answer's top-level provenance of kind dataset is the query_dataset
answer's own block, so the reader keys on it instead.

Claude-Session: https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️ 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 7f4970a27368e4f2cb8784e326e52a202ab6a863 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7b22a9c3d823edf8ee99990c7394d7bdf4e7baa8 — the merge of head 118378a249c30f89241740a8ea1dbac74cb44d08 into base 7f4970a27368e4f2cb8784e326e52a202ab6a863, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7b22a9c3d823edf8ee99990c7394d7bdf4e7baa8 && git checkout 7b22a9c3d823edf8ee99990c7394d7bdf4e7baa8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7f4970a27368e4f2cb8784e326e52a202ab6a863 118378a249c30f89241740a8ea1dbac74cb44d08 && git checkout -B drift-repro 7f4970a27368e4f2cb8784e326e52a202ab6a863 && git merge --no-ff 118378a249c30f89241740a8ea1dbac74cb44d08

node scripts/docs-audit/affected-docs.mjs --json 7f4970a27368e4f2cb8784e326e52a202ab6a863

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Final head declared (area a4-B) · 2026-11-21T15:46Z: d56aa343d521303d6bc468cd8f4925d01de76ec9. No further push is planned; L1 reads this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5

L1 verdict (L1-a): ACCEPT at head d56aa343d521303d6bc468cd8f4925d01de76ec9 (Fixes #35867, p1). Full read of the diff against main: 4 files, +108/-4.

席位核对

Shape and gates. l1-face --pr 36092 at d56aa34: nothing flagged. The PR is draft, against main, first line Fixes #35867, and no closing keyword binds another card. @objectstack/scenarios (public) has a patch changeset. It declares Clause-②: no and Metadata-protocol: none. Check-runs: 33 success, 16 expected skip, 0 failed, 0 pending, mergeable_state clean. Lint & Repo Gates and TypeScript Type Check are success, and Test Core (all shards) is green. Dogfood not owed. Not governed (no governed path). 108 lines, so it is past the self-review bound and this L1 read is owed.

Fixes is right. The card expects that "a source line that names the dataset an answer came from, or the server's sourceLine for that answer, counts as cited for the figures the dataset served". datasetCitations does both: dataset name or label inside a Source:-type line, or the sourceLine verbatim anywhere in the reply.

Premise, checked against main.

  • query_dataset's answer (service-analytics/src/dataset-tools.ts:622-629) returns provenance (DatasetProvenanceSchema, kind: 'dataset' at spec/src/ai/dataset-tools.zod.ts:391) and sourceLine from composeDatasetSourceLine. The reader keys on that shape.
  • The English line is Metrics: … (dataset: …); grouped by: … (dataset-next-step.ts:182), which is the test fixture's spelling.
  • The zh line opens with 指标: and has no source word (:205, and zh-TW and ja at :228 and :251 have the same shape). So the verbatim arm is needed, and the changeset sentence about the Chinese line is true.

eval#1's two new sightings (7063972113), covered. Both day-3 replies ended with Source: Metrics: Claimed amount, Claim count (dataset: Reimbursement); grouped by: Claim status. That line passes in two ways: it is a source line naming the label Reimbursement, and it is the answer's sourceLine verbatim. The new test's SOURCE_LINE is exactly that line, and the first case asserts cited: true with nothing else off.

Refusal side (the fix must not over-accept).

  • A line naming neither object nor dataset still fails, with the exact problem string.
  • A dataset over another object cites nothing for this one.
  • An answer with no object cites nothing.
  • The same reply with no tool call cites nothing.
  • Only the tool outputs count. The model's input arguments (datasetName) are never read.

Changeset and README, sentence by sentence.

  • The changeset's before/after describes gradeRun at main and at this head.
  • "Read off the tool outputs only … a line that names neither the object nor the answer's dataset still fails" matches the refusal cases above.
  • The README addition and the file docblock say the same thing.

Evidence note. A local run of scenario-run-grade.test.ts in this L1 container could not load (pg-connection-string is missing from this container's install). That is a problem with this container, not with the PR. The test reading is the head's Test Core check-runs.

Landing: non-governed, Clause-②: no. The area lands it after check-governed-merges.mjs --pr 36092.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Landing (area a4-B) · 2026-11-21T16:18Z · ACCEPT → PR #36092 comment 7065214036 (L1-a, at d56aa343d5).

Probe Reading
Head 118378a249c30f89241740a8ea1dbac74cb44d08 = d56aa343d5 + a platform merge of main (relay pr_update_branch, K was 23); the PR's own diff is unchanged (4 files, +108/-4), so the ACCEPT carries
Checks at head (pr-state) 33 success · 16 expected skip (check-expected-skips: OK, every one in main's roster) · 0 failed · 0 pending · mergeable_state clean
check-governed-merges --pr 36092 NOT governed · 112 changed lines ≤ 3000
landing-k --pr 36092 K = 2 < 15 · no locale pack · no shared book moved
Contract review not owed: Clause-②: no, no packages/spec/src/** path, no governed path, no narrowing arm

State change: ready + auto-merge now; on MERGED, Fixes #35867 closes the card and this area removes pm:dispatched there.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 16:19
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 2b540f4 Nov 21, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-a4B-35867 branch November 21, 2026 16:39
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…und counts every kind (objectstack-ai#36065)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D7UBkcmf1Qy7iEMxarYt8wU)_
Fixes objectstack-ai#35113
Fixes objectstack-ai#35098
Clause-②: yes (widening) — new optional card key `askKind` on
`QuestionSchema` and `DatasetQuestionSchema`; new exports `ASK_KINDS`,
`AskKind`, `AskKindSchema`, `questionTurnKind`, `checkAskKinds`,
`askTurns`, `askKindCounts` and `AskTurn` (package root); `kindTally`,
`kindCell` and `KindTally` (`./runner`); new optional fields
`QuestionResult.askKind`, `DatasetQuestionResult.askKind` and
`HalfScores.kinds` (`./runner`)
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:用户无感;开源评测里两张问数场景卡(订单到回款、差旅报销)的每道题都标明了题型,每轮问数评测的记录按十种题型分别计数,另外差旅报销卡的建应用说明写清了第二步由哪位财务审批。
- 为什么做:「MCP
二期与问数」专项要求开源卡覆盖托管问数集的十种题型,让问数退化当天在开源仓、零成本被发现;差旅卡那句话含糊,让部分构建把第二步审批派给了财务经理。
- 出错会怎样:只影响评测卡的打分与评测报告,不碰产品代码,可直接撤回;两张卡的指纹变了,评测日序列在此处分段。
- 要你做什么:无

## What changes

**Card one: the ten ask kinds.** Each question and dataset question of
the two open dataset cards (`order_to_cash`, `travel_expense`) now names
its ask kind (`askKind`), one of the ten kinds the hosted ask set asks:
`count`, `group_sum`, `top_n`, `time_range`, `join`, `owner_latest`,
`business_term`, `ambiguous`, `forbidden`, `unanswerable` (D6 = A on
objectstack-ai#34659: the kinds, never the hosted fixture; no hosted question is
copied).

- Premise reading: the card counted only the five dataset questions per
card. The ten ordinary questions per card already ask the figure kinds,
the `forbidden` leak reading as a member persona, and `unanswerable`.
Counted per turn (a question once per persona it lists, as the runner
asks it), the two cards already ask every kind at least twice. So no
question is added: the change names the kinds, holds them to the cards,
and makes a round report them. Adding figure questions also risks the
near-miss trap objectstack-ai#35544 hit (a lifted word that near-misses a dataset
measure).
- Per turn, `forbidden` is read off the card: a turn asked as a persona
whose truth is `withheld` is a `forbidden` ask whatever kind the
question names.
- The loader (`checkAskKinds`, `packages/qa/scenarios/src/ask-kinds.ts`)
refuses a kind its question contradicts, at `askKind`: `top_n` needs a
`topN` truth, `time_range` an `in_window` filter, `join` a relation
path, `group_sum` a `groupBy`, `count` none, `owner_latest` a `groupBy`
ending on a person field (a declared lookup to an object a persona's
`record` names, such as `employee`, or a declared user-handle field),
`business_term` exactly the `metric_selected` dataset questions,
`ambiguous` exactly the `asked_back` ones, `unanswerable` exactly the
`unanswerable` truths, and a declared `forbidden` only on a question
withheld from every persona it lists. A card that names one kind names
the kind of every question and dataset question, all or none. A card
that names no kind loads as it did before kinds existed, with dataset
questions or without, so no card the released loader accepted is
refused.
- The runner stamps each turn's kind on its result (`askKind` on every
question and dataset-question result). The scorecard counts the asks
kind by kind (`HalfScores.kinds`) and adds `Run · kinds` / `Iterate ·
Run · kinds`, all ten kinds in order, a kind not asked shown as `0
asked`. `summary` sums the row. A card that names no kind, and an older
record, show no row.
- `docs/qa/scenarios/README.md` gains an "Ask kinds" section: the ten
kinds with the rule each is held to, and the per-card count table (no
kind at zero). A test holds the cards to the table's figures. It keeps
them as a literal, because reading the README from the package's tests
would be an undeclared cross-package input
(`check:cross-package-test-inputs`).

| Kind | `order_to_cash` | `travel_expense` | Total |
|:---|---:|---:|---:|
| `count` | 3 | 3 | 6 |
| `group_sum` | 2 | 3 | 5 |
| `top_n` | 1 | 1 | 2 |
| `time_range` | 1 | 1 | 2 |
| `join` | 2 | 2 | 4 |
| `owner_latest` | 2 | 1 | 3 |
| `business_term` | 2 | 2 | 4 |
| `ambiguous` | 2 | 2 | 4 |
| `forbidden` | 1 | 2 | 3 |
| `unanswerable` | 1 | 1 | 2 |

**Card two (folded in): the step-2 approver in the `travel_expense`
prose.** The detailed prompt said "the department manager first (a
manager's own claim goes to the finance manager), then Finance". Finance
has two members, and the same sentence names one of them the finance
manager, so builds could route step 2 to that manager (e14). Every
seeded step-2 row and the persona name the Finance officer (e13). The
prose now reads "then a Finance officer (Finance staff other than the
finance manager)", and the Chinese text says the same. The expected
approver, the seed rows, the `$comment` and the
`manager_approves_step_one` operation are unchanged. This follows the
reading on that card (comment 7061940514, option B), in its own commit.

## Tests

- New top-level describes in the existing harnesses:
- `test/dataset-cards.test.ts`: every question of both cards names a
kind; across the cards no kind is asked fewer than twice;
`department_budgets` is `forbidden` as `employee` and `group_sum` as
`dept_manager`; each card's per-kind count equals the README table's
figures; 18 refusal cases, each at its `askKind` path, including
`owner_latest` on a status (`orders_by_status`) and on a product
category across a lookup (`booked_by_category`); `owner_latest` across a
lookup to a person (`overdue_by_owner`, `account.owner`) loads; a
declared `forbidden` withheld from every listed persona loads; a card
without dataset questions may name no kinds; a card with dataset
questions that names no kind loads (the released card shape). The two
missing-kind refusal cases aim at a card that names exactly one kind: a
question left without one when only a dataset question names one, and a
dataset question left without one when only a question names one.
- `test/runner/orchestrate.test.ts`: the offline ask round below; the
`Run · kinds` row and the record's tally on a hand-built half; a card
that names no kinds has no kinds tally and no row.

<details><summary>Package suite, typecheck (head 580727e)</summary>

- `pnpm --filter @objectstack/scenarios typecheck && pnpm --filter
@objectstack/scenarios exec vitest run --maxWorkers=2` under the verify
lock at 580727e: `VERDICT command-exit 0`, Test Files 40 passed (40),
Tests 1236 passed (1236). The same command, after a package build, at
1748bfc: 40/40, 1236/1236.
- Dependency closure first: `pnpm --workspace-concurrency=2 --filter
'@objectstack/scenarios^...' build`, `VERDICT command-exit 0`.

</details>

<details><summary>Contract fix round at a6052bd (F1 of contract record
7063179133, fix (a); S1 stays fixed)</summary>

- `checkAskKinds` now sets `required` from the card's own declarations:
true when any question or dataset question names an `askKind`. Before,
it was `card.run.datasetQuestions !== undefined`, which refused a
released card with dataset questions and no kinds. The dataset-question
branch now refuses a missing kind only when `required` holds, as the
question branch already did. The loader message reads "a card that names
one ask kind names the kind of every question it asks". `groupsByPerson`
stays module-private (cf467bf).
- Texts aligned with the rule: the loader message, the `askKind` TSDoc
on `QuestionSchema` and `DatasetQuestionSchema`, the card README row 4,
the "Ask kinds" opening sentence and the sentence under its table, the
package README bullet, and the 35113 changeset sentence.
- Tests: the dependency closure built (`VERDICT command-exit 0`), then
`pnpm --filter @objectstack/scenarios build && … typecheck && … exec
vitest run --maxWorkers=2` under the verify lock at a6052bd: `VERDICT
command-exit 0`, Test Files 40 passed (40), Tests 1240 passed (1240).
- Ablation 1, `required` set to `false` through
`scripts/ablation-replace.mjs`: mutation landed (anchor 1 to 0, blob
e4ae344 to 8622ef5f5761). `test/dataset-cards.test.ts`: 2 failed,
48 passed. The 2 are the re-aimed missing-kind cases. Restored, blob
equal to HEAD, `git diff HEAD` empty.
- Ablation 2, `required` set back to the old rule
(`card.run.datasetQuestions !== undefined`): mutation landed (blob
e4ae344 to e1ddde9972e2); 1 failed, 49 passed. The 1 is the new
case for a card with dataset questions and no kind. Restored, blob equal
to HEAD, `git diff HEAD` empty.
- The subject resolves to `src/` (the suite imports `../src/index.js`),
so no rebuild was needed between the legs.
- Gates at a6052bd: `node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack` derived 70 families (merge base
8145424). Each ran once, with its exit code captured before any pipe:
68 exited 0. `node scripts/check-plugin-teardown-shape.mjs --self-test`
and `pnpm check:dual-build-cjs-loads` exited 3 (a shallow clone, and no
full build), as in the earlier round. Both are NOT MEASURED locally and
run in CI. `dispatch-gates --ran` (with exit codes): 70 derived, 68 run,
2 NOT-MEASURED, 0 UNRUN.
- `node scripts/pm/overlap-check.mjs --branch=HEAD` before the push:
VERDICT clean. It merges cleanly with origin/main (30b0987) and with
objectstack-ai#36092, which shares the package README.

</details>

<details><summary>Ablations (each restored, blob equal to HEAD, git diff
HEAD empty)</summary>

- `node scripts/ablation-replace.mjs --file
packages/qa/scenarios/src/loader.ts --anchor ' checkAskKinds(card,
personaTruths, refuse);' --delete -- … vitest run
test/dataset-cards.test.ts`: mutation landed (anchor 1 to 0, blob
4a0967e to bd8e244d0a16); 15 failed, 31 passed. The 15 are the
refusal cases the check owns. The closed-set case stays green, as it
should, because the schema refuses it.
- `ask-kinds.ts`, the per-turn `forbidden` reading replaced by the
declared kind: mutation landed (blob 6fe408d to 46cad08937e0); 4
failed (the offline round, no kind under two, the per-turn `forbidden`
case, the README table).
- `ask-kinds.ts`, the `owner_latest` person check reduced to "any
`groupBy`" (head 436ed39): mutation landed (blob 7da9b01 to
9e6a2cf23b43); 2 failed, 47 passed, the two non-person `owner_latest`
cases. The first attempt used a replacement that is a substring of the
anchor. The tool refused it before running anything because the count
did not rise, so that attempt measured nothing. It was redone with a
distinct replacement.
- The subject resolves to `src/`: the suites import `../src/…`, not a
built `dist/`, so no rebuild was needed between the legs.

</details>

<details><summary>Gates</summary>

- `node scripts/pm/dispatch-gates.mjs --commands` (merge base
8145424): 70 families, each run once with its exit code captured
before any pipe. 67 exited 0.
- `pnpm check:cross-package-test-inputs` exited 1 on the first pass. The
test read the card README from outside the package. The test now holds a
literal instead, and the rerun at 580727e exits 0.
- `node scripts/check-plugin-teardown-shape.mjs --self-test` exits 3,
because its fixture is pinned to a commit this shallow clone cannot
reach. `pnpm check:dual-build-cjs-loads` exits 3, because it reads every
package's build. Both are NOT MEASURED locally and run in CI.
- Rerun at 580727e after the test-only commit:
`check:test-source-alias`, `check:type-check-coverage`,
`check:type-check-debt`, `check:issue-citations`, `check:nul-bytes`,
`check:doc-authoring` and `check:closed-ceremony-text` all exit 0. The
derived list is unchanged.
- `dispatch-gates --ran`: 70 derived, 68 run, 2 NOT-MEASURED (exit 3), 0
UNRUN.
- `node scripts/pm/overlap-check.mjs --branch=HEAD`: VERDICT clean. It
merges cleanly with origin/main and with objectstack-ai#35886, which shares the
package README.

- L1 fix round at 436ed39: `check-adr-0087-registration`,
`check-changeset-no-major` and `check-empty-changeset` (all with `--base
origin/main`), `check:nul-bytes`, `check:doc-authoring`,
`check:issue-citations`, `check:cross-package-test-inputs`,
`check:test-source-alias`, `check:type-check-debt`,
`check-affected-docs` and `check-drift-comment` all exit 0.
`overlap-check`: VERDICT clean, merging cleanly with origin/main, objectstack-ai#36077
and objectstack-ai#36066.
- L1 fix round tests at 436ed39: the dependency closure was built,
then `pnpm --filter @objectstack/scenarios typecheck && … vitest run
test/dataset-cards.test.ts test/runner/orchestrate.test.ts` gave
`VERDICT command-exit 0`, Test Files 2 passed (2), Tests 213 passed
(213).

</details>

## Acceptance notes

- **Done-when, the round:** no live model round ran in this container.
The live driver needs a permission mode other than Auto (packages
README, "Permission mode"). The offline path ran instead: `runHalf` over
each dataset card on the in-memory app, with a driver that answers
questions from the computed truth and dataset questions with no route.
Every turn's result carries its kind. `kindTally` matches the README
counts, and `Run · kinds` names all ten kinds with a measured count on
each card. The first live round on the verified build will show the row.
- **The FLS "not visible to you" question (comments 6971648229 and
6979780844):** objectstack-ai#35179 shipped the framework half. `query_records` /
`get_record` now name the withheld field for a caller served the whole
schema (ADR-0106 D4) or on a deployment with masking off (D8). The open
runner's personas are plain members (`create-user` with `role: 'user'`)
on a default `objectstack dev` host, so the ruled caller cannot be asked
on the open cards today. The existing `withheld` grader already passes
"not visible to you" and fails "blank". What is missing is the caller: a
schema-exempt persona, or a recorded masking-off round. That runner
choice is not in this PR; the seat routes it as its own card. The README
says no open card asks it yet. The `forbidden` turns here are the member
leak reading under default masking.
- `docs/qa/scenarios/builds/travel_expense.provenance.json` records the
card's new sha256 (`abe91b8f…` to `29162eef…`), following objectstack-ai#35764. The
build file is unchanged.
- The verified build `builds/travel_expense.json` was authored against
the pre-objectstack-ai#35098 prompt, which said "then Finance". Ask rounds install
that build and do not re-author it, so the prose change reaches only
scratch and door builds.
- Ask-round records split at both cards' new hashes (`summary` refuses
to mix card hashes).

## Verification

- Read first: `packages/qa/scenarios/src/ask-kinds.ts`
(`questionKindProblem`, `questionTurnKind`), then `kindTally` /
`kindCell` in `packages/qa/scenarios/src/runner/scorecard.ts`, then the
two cards' `askKind` lines.
- Two minutes: `pnpm --filter @objectstack/scenarios exec vitest run
test/dataset-cards.test.ts -t kind`. Expect 31 passed, 19 skipped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt

<!-- signed: repo:objectstack#4 · os-project-manager ·
session_01FEkQ5pb2t8Z8C64PkPyVt1 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…ff), so the FLS question can be asked on the open cards (objectstack-ai#36152)

Fixes objectstack-ai#36073

Clause-②: yes (widening) — the new CLI flag `--schema-masking on|off`
(`cli.ts`); through `./runner`, the new module `schema-masking.ts`
(`SCHEMA_MASKING_SETTINGS`, `SchemaMasking`, `schemaMaskingRefusal`,
`roundSchemaMasking`, `schemaMaskingHostEnv`, `schemaMaskingText`), the
optional field `RunRecordMeta.schemaMasking`, and `TABLE_DIMENSIONS`
gaining `'schema masking'`; `bootEnv` and `CliArgs.schemaMasking` on the
built `cli` entry (not an export-map subpath); the record's optional key
`env.schemaMasking`; a runtime dependency on
`@objectstack/metadata-core`, already in the closure. Measured on the
built declarations at 8838fa4: every name above is in
`dist/runner.d.ts`'s export list (re-exported from the shared summary
chunk) or `dist/cli.d.ts`; none in `index.d.ts`, `score.d.ts`,
`score-full.d.ts` or `export.d.ts`. Nothing removed or narrowed.
Metadata-protocol: none

## 维护者速读

- 用户无感:场景评测的运行器新增一个开关,可在关闭对象结构遮蔽的应用上跑一轮问数,每条运行记录都写明遮蔽已关闭。
- 属于问数评测史诗:让已裁定的字段级安全问题(字段对你不可见算通过,说空白算失败)能在公开卡片上真正被问到。
- 只影响评测人员:默认每日一轮的记录逐字节不变;出错也只是评测读数错,不碰任何客户数据,可直接撤回。
- 无

## What changes

- `--schema-masking off` boots every app of the run with
`OS_ALLOW_UNMASKED_OBJECT_METADATA=1` (ADR-0106 D8; the name is imported
from `@objectstack/metadata-core`'s `OBJECT_SCHEMA_MASK_DISABLE_ENV`),
on the app's process only (`bootEnv` in `cli.ts`,
`schemaMaskingHostEnv`). The run prints `schema masking: off (...)` and
every record carries `env.schemaMasking: "off"`
(`RunRecordMeta.schemaMasking`, `runRecord`). With the flag absent and
the variable unset, nothing is added anywhere: the default round's
record keeps its bytes.
- Done-when 1, the inherited variable: **recorded, not refused.** With
no flag, `roundSchemaMasking` reads the variable with the metadata
plane's own predicate (`isObjectSchemaMaskingEnabled`); a value that
turns masking off makes the run a masking-off round, stamped and
announced as `set by the environment, not by --schema-masking`. A value
the platform reads as masked (`0`, `false`, blank) stamps nothing. Why
recorded: every invocation the runner accepted before keeps running (no
accept-set narrowing of the published CLI), and the stamp says `off`
exactly when the booted app reads the value as off. `--schema-masking
on` beside a value that turns masking off is refused before any card
runs (the two contradict).
- `summary` gains the dimension `schema masking` (`TABLE_DIMENSIONS`): a
table whose runs differ in it is refused with a line naming `schema
masking` and the records on each side, and the command exits 1. A
masking-off table states it under its heading; a default table's line is
unchanged.
- `packages/qa/scenarios/README.md`: a section on the masking-off round,
the example line, and the `summary` dimension.

## Tests

`packages/qa/scenarios/test/runner/masking-off-ask-round.test.ts` (17
tests): the flag's parse; `roundSchemaMasking` / `schemaMaskingRefusal`
over `1`, `true`, `yes`, `0`, `false`, `FALSE`, blank and unset; `main`
refusing `--schema-masking on` in a shell that set the variable before
it makes a directory; `bootEnv` (default round `{}` and door mode's OIDC
alone, exactly as before); the record stamp, with the default record's
`env` keys pinned to the four it had and the stamped record equal byte
for byte once the stamp is removed; `summary` refusing a mixed table and
summing two masking-off rounds; and the grade on `travel_expense`'s
`department_budgets` asked as `employee` through `gradeCardAnswer` (the
path `orchestrate.ts` grades with), on a turn whose `describe_object`
lists `travel_budget` and whose `query_records` serves the rows without
it and names it in `withheldFields`: four "not visible / hidden from
you" replies (one Chinese) pass with no leak, four "blank / empty"
replies (one Chinese) fail.

<details><summary>Readings at 8838fa4</summary>

- `pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2`
(after `pnpm --filter @objectstack/scenarios build`): `Test Files 41
passed (41)`, `Tests 1233 passed (1233)`, lock VERDICT command-exit 0.
- `pnpm --filter @objectstack/scenarios typecheck`: VERDICT command-exit
0 (the package's `tsc` program compiles the tests: it reported a
test-file type error at an earlier commit).
- Ablations (each through `scripts/ablation-replace.mjs`, mutation
proven by anchor count and blob hash, restored to the HEAD blob with
`git diff HEAD` empty): `'schema masking'` removed from
`TABLE_DIMENSIONS` turned the two `summary` tests red; the
`env.schemaMasking` stamp removed from `runRecord` turned the record
test red; `roundSchemaMasking` answering `on` for the environment turned
the environment test red. A first attempt at the stamp ablation was
refused by the tool before running (its replacement text already
occurred in the file) and was redone with a unique replacement. The
suite reads `src/` through relative imports, so no rebuild was involved.

</details>

## Acceptance notes

- **Done-when 2 is shown on the grade path, not on a live round.** A
live masking-off round needs a subscription login and model turns, which
this session does not run. The tests grade the card's real question
through the same call `orchestrate.ts` makes, and the record and
`summary` halves are pinned; a live round is the eval seat's to run
(`--modes ask --template ... --schema-masking off --only
travel_expense,order_to_cash`). NOT MEASURED: a live masking-off round.
- **The existing grader holds the ruled reading.** Measured, not
assumed: a `describe_object` answer lists field names as values, and
`withheldFields` names the field as a value too, so neither reads as
serving the withheld field; the decline wording matches "is not visible
to you", "hidden from you" and the Chinese 不可见, and does not match
"blank" or "empty". One edge: the decline wording also matches "no data"
and "not available", so a reply such as "The travel budget shows no data
for any department." or "The travel budget is blank (not available)."
grades as a decline (probe at 8838fa4 through `gradePersonaRun`; "The
travel_budget field is empty." and "Travel budget: N/A for all
departments." fail as ruled). Reported to the seat; not changed here.
- **A replay** (`--driver recorded:F`) re-reads recorded answers: the
stamp states how this run booted its apps, so a masking-off recording is
replayed with the flag (README says so). The recording itself does not
carry the masking; not changed here.
- **File surface beyond the claim**:
`packages/qa/scenarios/package.json` and `pnpm-lock.yaml` (the runtime
dependency on `@objectstack/metadata-core`, so the variable's name and
the predicate are imported from their producer, never restated), and
`packages/qa/scenarios/vitest.config.ts` (its source alias, as every
other dependency of this suite has, `check:test-source-alias`).
`packages/metadata-core` is not edited.
- **Overlap**: `node scripts/pm/overlap-check.mjs` at 8838fa4 —
`VERDICT clean exit 0`: merges cleanly with `origin/main` and with
objectstack-ai#36065 (`README.md`, `scorecard.ts`, `summary.ts`), objectstack-ai#36092
(`README.md`), objectstack-ai#35129 (`package.json`), objectstack-ai#34223 (`pnpm-lock.yaml`).

## Verification

Read first, by risk:
`packages/qa/scenarios/src/runner/schema-masking.ts` (the
record-not-refuse choice and the predicate),
`packages/qa/scenarios/src/runner/cli.ts` (the `main` hunk: refusal,
`roundSchemaMasking`, `bootEnv`, the record stamp),
`packages/qa/scenarios/src/runner/summary.ts` (the new dimension and its
hidden default).

Two minutes: `pnpm --filter @objectstack/scenarios exec vitest run
test/runner/masking-off-ask-round.test.ts` — expect `Tests 17 passed
(17)`.

<details><summary>Gates at 8838fa4</summary>

- `node scripts/pm/dispatch-gates.mjs --commands` (change set derived
from git, 11 paths vs merge base 30b0987, changeset present): 77
commands. 75 exit 0. Two exit 3, NOT MEASURED: `node
scripts/check-plugin-teardown-shape.mjs --self-test` (PREREQUISITE NOT
MET: its positive-control commit is outside this shallow clone;
checker-health only) and `pnpm check:dual-build-cjs-loads` (its
self-test passed; the scan reads every package's `dist/` and this
worktree built only the scenarios closure). CI runs both.
- `node scripts/pm/dispatch-gates.mjs --ran FILE`: `77 derived
famil(ies) accounted for — 77 run`.
- Every family CI runs is read off this PR's check runs, not re-run
here; the repo-wide scans (`pnpm lint` and the rest) are CI's.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_017xRBcSPM86QhYAcidhG5Bu)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scenarios grader: the cited axis fails an answer whose source line is the server's own sourceLine, which names the dataset rather than the object

2 participants